package com.mrzhou.thread.study;

import lombok.extern.slf4j.Slf4j;

/**
 * P23 线程常用方法Sleep_状态
 * @author qiang.zhou
 */
@Slf4j
public class P23ThreadSleepState {

    public static void main(String[] args) throws Exception {
        Thread t = new Thread(() -> {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }, "t1");
        t.start();

        log.info("t1 state....{}", t.getState());

        // 主线程休眠
        Thread.sleep(1000);

        log.info("t1 state....{}", t.getState());
    }

}
